#include <queue>
#include <string>
#include <cstdint>
#include <iostream>
using namespace std;

struct Student {
    uint32_t id;
    string name;
    uint32_t age;
    uint32_t score;
};

struct CompareByScore {
    bool operator()(const Student& a, const Student& b) {
        // 小堆排序
        // return a.score > b.score;

        // 大堆排序
        return a.score < b.score;
    }
};

int main()
{
    priority_queue<Student, vector<Student>, CompareByScore> maxHeap;

    maxHeap.push({ 1, "Tom", 18, 70 });
    maxHeap.push({ 2, "Jerry", 17, 50 });
    maxHeap.push({ 3, "Alice", 19, 80 });

    Student tmp = maxHeap.top();
    cout << tmp.id << " " << tmp.name << " " << tmp.age << " " << tmp.score << endl;
}
/* 运行结果:
3 Alice 19 80

*/